// https://www.cnblogs.com/lyxcode/p/9655743.html
function bdLogin() {
  const baiduserverUrl = 'https://openapi.baidu.com/oauth/2.0/authorize'
  const params = {
    response_type: 'authorization_code',
    client_id: 'pg2EFdTwHevfa16EoYmZwwMY',
    redirect_uri: 'http://www.srxboys.cn:8887/',
    display: 'popup',
  }
  // location.href="https://openapi.baidu.com/oauth/2.0/authorize?response_type=code&client_id=RcMfDQbylVtIvUIhNtNIW0W1&redirect_uri=http://www.lyxwz.top/venu/BaiDuServlet&display=popup";

  // 爱奇艺 - pc - 百度授权登录
  // https://openapi.baidu.com/oauth/2.0/authorize?client_id=VdUQE9922EiS7Qb5N7oFGX8s&confirm_login=1&display=page&errmsg=Auth+Login+Sucess&errno=0&redirect_uri=http%3A%2F%2Fpassport.iqiyi.com%2Fapis%2Fthirdparty%2Fncallback.action%3Ffrom%3D1&response_type=code&ssnerror=0&state=CiAzZTEzM2QxMzljYmZiMGY1MmUwNWFjNTJkYmNlZmViNRABKgExMABQAWAAaiAxNWM3ZGQzN2ExOWNhNjhiNTRkZTFhOGMzODk3YjNjNIIBQWh0dHA6Ly9wYXNzcG9ydC5pcWl5aS5jb20vYXBpcy90aGlyZHBhcnR5L25jYWxsYmFjay5hY3Rpb24_ZnJvbT0xiAEBkAEAyAEB2gEUMDEwMTAwMjEwMTAwMDAwMDAwMDCaAitodHRwczovL3d3dy5pcWl5aS5jb20vdGhpcmRsb2dpbi9jbG9zZS5odG1sogIraHR0cHM6Ly93d3cuaXFpeWkuY29tL3RoaXJkbG9naW4vY2xvc2UuaHRtbKoCATG6AgEx&stoken=GOHDFZ5fssgr17t3pZyYBmCvgbobb8M1YHhh8AvR3ukzwiNKCRfenGPGaYzdsoAIBauTVBpg0vQVd3p9cdCVx7LgtiIPiROPZrakUF5SQ53xd9ouEWP8LbE9owwS%2B3sTpecvKhKwp9AgWsqi1vHeZH02BTPffYRxICaldcSwApNaUqBMu7%2BpC6u4P%2FwOFAswq6VQ3X6ZvdSFw7fU09uVjDZsKtW0lmextNn7pj68Rw%2Bz4%2Br5zJ7A%2BkE8gie9QR6wBGYsX%2FUnpPROlvhuLJ202g

  // 爱奇艺 - mobile - 百度授权登录
  //https://openapi.baidu.com/oauth/2.0/authorize?confirm_login=1&display=mobile&response_type=code&redirect_uri=https%3A%2F%2Fpassport.iqiyi.com%2Fapis%2Fthirdparty%2Fncallback.action%3Ffrom%3D1&client_id=VdUQE9922EiS7Qb5N7oFGX8s&state=CiA4MDI1YTMxNzQ5MTkzNjc5ZDRhZTllYWI0ZmM0YjhkOBAMMAA6ATFQAWAAaiAxNWM3ZGQzN2ExOWNhNjhiNTRkZTFhOGMzODk3YjNjNIIBQmh0dHBzOi8vcGFzc3BvcnQuaXFpeWkuY29tL2FwaXMvdGhpcmRwYXJ0eS9uY2FsbGJhY2suYWN0aW9uP2Zyb209MYgBAZABAMgBAdoBFDAyMDMyMDAxMDEwMDAwMDAwMDAw-gEBMZoCcWh0dHBzOi8vbS5pcWl5aS5jb20vdXNlci5odG1sP3JlZGlyZWN0X3VybD1odHRwcyUzQSUyRiUyRm0uaXFpeWkuY29tJTJGdSUyRiZzdXNCbG9jaz1iYWlkdV9zdWMjdGhpcmRQYXJ0eUNhbGxiYWNrogJxaHR0cHM6Ly9tLmlxaXlpLmNvbS91c2VyLmh0bWw_cmVkaXJlY3RfdXJsPWh0dHBzJTNBJTJGJTJGbS5pcWl5aS5jb20lMkZ1JTJGJnN1c0Jsb2NrPWJhaWR1X3N1YyN0aGlyZFBhcnR5Q2FsbGJhY2u6AgEx

  let url = baiduserverUrl
  for (let key in params) {
    const value = params[key] || ''
    url = url + '&' + key + '=' + value
  }
  console.log('url=', url)

  setTimeout(() => {
    location.href = url
  }, 10);
}